<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> New Document </title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <script src="http://media.kuaiwan.com/static/v2.5.1/gamelib/js/jquery-1.6.1.min.js" type="text/javascript"></script>
	<script>
	function openWindow(url) {
      window.external.CALL_API("OpenWindow", url);
	}

	function checkAPI() { //检测是否安装快玩
		var kuaiwan = null;
		if($.browser.msie) {
			try{
				kuaiwan = new ActiveXObject("KWCheck.KuaiWan");
				kuaiwan.Query("");
				return true;
			}catch(e){
				return false;
			}
		}else {
			try{
				var plugin = "<object "+
					"<embed id=\"KWCheck\" name=\"KWCheck\""+
					"Query='<invoke></invoke>'"+
					"type=\"application/kwcheck-plugin\" width=\"0\" height=\"0\">"+
					"</embed>"+
					"</object>";
				$(plugin).appendTo(document.body);
				document.getElementById("KWCheck").Query(1);
				return true;
			}catch(e){
				return false;
			}
		}
	};

	function downLoadGame(gameid, gamename, game_type) { //下载, 开始游戏
		var kuaiwan;
		var fromString = "www";
		var game_type = game_type == "webgame" ? "webgame" : '' ;
		var plugin = "<object "+
			"<embed id=\"KWCheck\" name=\"KWCheck\""+
			"Query='<invoke name=\"startgame\" gamename=\""+gamename+"\" gameid=\""+gameid+"\"  from=\""+fromString+"\" gametype=\""+game_type+"\"></invoke>'"+
			"type=\"application/kwcheck-plugin\" width=\"0\" height=\"0\">"+
			"</embed>"+
			"</object>";
		
		try{
			if($.browser.msie) {
				kuaiwan = new ActiveXObject("KWCheck.KuaiWan");
				var xmlkuaiwan = "<invoke name=\"startgame\" gametype=\""+game_type+"\" gamename=\"" + gamename + "\" gameid=\"" + gameid + "\" from=\""+fromString+"\"></invoke>";
				kuaiwan.Query(xmlkuaiwan);
			} else {
				$(plugin).appendTo(document.body);
				try{
					var a = 1;
					document.getElementById("KWCheck").Query(a);
				}catch(e) {
					notInstallKuaiwanTemplates()
				}
			} try {

			}catch(e){
			};
		}catch(e){
			
		}
	};
	</script>
 </head>

 <body>
    <a href="javascript:openWindow('http://www.kuaiwan.com/|快玩游戏|400|300')">打开窗体</a>
	<a href="javascript:alert(checkAPI());">是否安装快玩(检测)</a>
	<a href="javascript:downLoadGame('30', '植物大战僵尸', 'exe');">启动游戏</a>
 </body>
</html>
